# =============================================================================
find_package(OpenSSL REQUIRED)

macro(use_openssl ag_project_name)
  target_compile_definitions(${ag_project_name} PRIVATE USE_LIB_OPENSSL)

  target_include_directories(${ag_project_name} PRIVATE ${OPENSSL_INCLUDE_DIR})
  if (OS_WINDOWS)
    target_link_libraries(${ag_project_name} PRIVATE ws2_32 wsock32 Crypt32 OpenSSL::SSL OpenSSL::Crypto)
  elseif (OS_LINUX)
    target_link_libraries(${ag_project_name} PRIVATE OpenSSL::SSL OpenSSL::Crypto)
  endif()
endmacro(use_openssl)